# -*-coding:utf-8-*-

import json
import os.path


# 写成一个方法是为了方便复用
def read_config():
    with open('./dataProcess/file_location.json', 'r') as load_file:
        conf = json.load(load_file)
    return conf


CONFIG = read_config()


#  从文件中读取所有的搜索记录并以lines的形式返回
def process_data():
    data_location = CONFIG["location"]["data_root"]
    data_after_process_filename = CONFIG["location"]["data_after_process"]
    data_after_process = os.path.join(data_location, data_after_process_filename)
    with open(data_after_process, 'r', encoding='UTF-8') as f:
        lines = f.readlines()
    return lines
